<form id="edit-form" class="form-horizontal" style="position:relative;background: #fff" role="form"
      data-toggle="validator" method="POST" action="">
    <div class="panel">
        <ul class="nav nav-tabs">
            <li class="active"><a href="#tabs_0" data-toggle="tab" aria-expanded="true">课程信息</a></li>
            <li><a href="#tabs_2" data-toggle="tab" aria-expanded="true">教学点</a></li>
            <li><a href="#tabs_1" data-toggle="tab" aria-expanded="true">课堂类型</a></li>
            <li><a href="#tabs_4" data-toggle="tab" aria-expanded="true">参数设置</a></li>
            <li><a href="#tabs_5" data-toggle="tab" aria-expanded="true">老师模式</a></li>
            <li><a href="#tabs_6" data-toggle="tab" aria-expanded="true">空中课堂</a></li>
            {if $admin["group_id"]==1||$admin["group_id"]==2||$admin["group_id"]==3}<li><a href="#tabs_3" data-toggle="tab" aria-expanded="true">批处理课程事件</a></li>{/if}
        </ul>
    </div>
    <div class="panel-body">
        <div id="myTabContent" class="tab-content">
            <div class="tab-pane fade active in" id="tabs_0">
                <input TYPE="hidden" id="row" NAME="data" VALUE='{$row|json_encode|htmlentities}'/>

                {if $admin['group_id']==3}
                <input type="hidden" id="h-rel_type" name="row[rel_type]" value="1">
                <input type="hidden" id="h-rel_id" name="row[rel_id]" value="{$admin['school_id']}">
                {elseif $admin['group_id']==8}
                <input type="hidden" id="h-rel_type" name="row[rel_type]" value="2">
                <input type="hidden" id="h-rel_id" name="row[rel_id]" value="{$admin['community_id']}">
                {else}
                <div class="form-group">
                    <label for="c-rel_type" class="control-label col-xs-12 col-sm-2">主体类型:</label>
                    <div class="col-xs-12 col-sm-8" id="div-rel_type">
                        <select name="row[rel_type]" id="c-rel_type" class="form-control selectpicker" data-rule=""
                                data-tip="主体类型">
                            <option value="1">学校</option>
                            <option value="2">社区</option>
                        </select>
                    </div>
                </div>

                <div class="form-group">
                    <label for="c-rel_id" class="control-label col-xs-12 col-sm-2">主体:</label>
                    <div class="col-xs-12 col-sm-8" id="div-rel_id">
                        <select name="row[rel_id]" id="c-rel_id" class="form-control" data-tip="主体">
                        </select>
                    </div>
                </div>
                {/if}

                <div class="form-group">
                    <label for="c-title" class="control-label col-xs-12 col-sm-2">课程名称:</label>
                    <div class="col-xs-12 col-sm-8" id="div-title">
                        <input type="text" id="c-title" name="row[title]" value="{$row.title}" class="form-control"
                               title="title" placeholder="" data-rule="" data-tip="课程名称"/>
                    </div>
                </div>

                <div class="form-group">
                    <label for="c-course_cover" class="control-label col-xs-12 col-sm-2">课程封面:</label>
                    <div class="col-xs-12 col-sm-8" id="div-course_cover">
                        <div class="form-inline">
                            <input id="c-course_cover" class="form-control" size="39" name="row[course_cover]"
                                   type="text" value="{$row.course_cover}" data-tip="">
                            <span><button type="button" id="plupload-course_cover" class="btn btn-danger plupload"
                                          data-input-id="c-course_cover" data-mimetype="image/*" data-multiple="false"
                                          data-preview-id="p-course_cover"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                            <span><button type="button" id="fachoose-course_cover" class="btn btn-primary fachoose"
                                          data-input-id="c-course_cover" data-mimetype="image/*"
                                          data-multiple="false"><i
                                    class="fa fa-list"></i> {:__('Choose')}</button></span>
                            <ul class="row list-inline plupload-preview" id="p-course_cover"></ul>
                        </div>
                    </div>
                </div>

                <div class="form-group">
                    <label for="c-intro" class="control-label col-xs-12 col-sm-2">课程内容:</label>
                    <div class="col-xs-12 col-sm-8" id="div-intro">
                        <textarea name="row[intro]" id="c-intro" class="form-control" data-rule="" rows="5"
                                  data-tip="课程内容">{$row.intro}</textarea>
                    </div>
                </div>

                <div class="form-group">
                    <label for="c-course_type" class="control-label col-xs-12 col-sm-2">课程类型:</label>
                    <div class="col-xs-12 col-sm-8" id="div-course_type">
                        {if $admin.group_id==3 || $admin.group_id==2|| $admin.group_id==1}
                        <label for="row[course_type]-1"><input id="row[course_type]-1" name="row[course_type]"
                                                               type="radio" value="1" {if $row["course_type"]=="1"}checked{/if}
                            /> 学校课堂</label>{/if}
                        {if $admin.group_id==8 || $admin.group_id==2|| $admin.group_id==1}
                        <label for="row[course_type]-2"><input id="row[course_type]-2" name="row[course_type]"
                                                               type="radio" value="2" {if $row["course_type"]=="2"}checked{/if}
                            /> 社区课堂</label>{/if}

                        <label for="row[course_type]-3"><input id="row[course_type]-3" name="row[course_type]"
                                                               type="radio" value="3" {if $row["course_type"]=="3"}checked{/if}
                            /> 校外课堂</label>
                    </div>
                </div>

                <div class="form-group">
                    <label for="c-status" class="control-label col-xs-12 col-sm-2">状态:</label>
                    <div class="col-xs-12 col-sm-8" id="div-status">
                        <input id="c-status" name="row[status]" type="hidden" value="{$row.status}">
                        <a href="javascript:;" data-toggle="switcher" class="btn-switcher" data-input-id="c-status"
                           data-yes="1" data-no="0">
                            <i class="fa fa-toggle-on text-success {eq name=" $row.status" value="0"}fa-flip-horizontal
                            text-gray{/eq} fa-2x"></i>
                        </a>
                        <div data-favisible="switch=1" class="p-3">已开户</div>
                    </div>
                </div>

                <div class="form-group">
                    <label for="c-is_post" class="control-label col-xs-12 col-sm-2">是否发布:</label>
                    <div class="col-xs-12 col-sm-8" id="div-is_post"><input id="c-switch" name="row[is_post]"
                                                                            type="hidden" value="{$row.is_post}">
                        <a href="javascript:;" data-toggle="switcher" class="btn-switcher" data-input-id="c-switch"
                           data-yes="1" data-no="0" data-confirm="确认切换开关？">
                            <i class="fa fa-toggle-on text-success {eq name=" $row.is_post" value="0"}fa-flip-horizontal
                            text-gray{/eq} fa-2x"></i>
                        </a></div>
                </div>


                <div class="form-group layer-footer">
                    <label class="control-label col-xs-12 col-sm-2"></label>
                    <div class="col-xs-12 col-sm-8">
                        <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
                        <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
                    </div>
                </div>
            </div>
            <div class="tab-pane fade in" id="tabs_2">

                <div class="form-group">
                    <label for="c-address_lv" class="control-label col-xs-12 col-sm-2">教学点标签:</label>
                    <div class="col-xs-12 col-sm-8" id="div-address_lv">
                        <select name="row[address_lv]" id="c-address_lv" class="form-control" style="height:350px">
                        </select>
                    </div>
                </div>

                <div class="form-group">
                    <label for="c-ocation_id" class="control-label col-xs-12 col-sm-2">教学点ID:</label>
                    <div class="col-xs-12 col-sm-8" id="div-ocation_id">
                        <select name="row[ocation_id]" id="c-ocation_id" class="form-control">
                        </select>
                    </div>
                </div>

                <div class="form-group">
                    <label for="c-address" class="control-label col-xs-12 col-sm-2">上课地点:</label>
                    <div class="col-xs-12 col-sm-8" id="div-address">
                        <input type="text" id="c-address" name="row[address]" value="{$row.address}"
                               class="form-control" title="address" placeholder="" data-rule="" data-tip="上课地点"/>
                    </div>
                </div>

                <div class="form-group">
                    <label for="c-address_ext" class="control-label col-xs-12 col-sm-2">地址补充信息:</label>
                    <div class="col-xs-12 col-sm-8" id="div-address_ext">
                        <input type="text" id="c-address_ext" name="row[address_ext]" value="{$row.address_ext}"
                               class="form-control" title="address_ext" placeholder="" data-rule=""
                               data-tip="地址补充信息"/>
                    </div>
                </div>
            </div>
            <div class="tab-pane fade in" id="tabs_1">
                {if $admin["group_id"]==1||$admin["group_id"]==2||$admin["group_id"]==8}
                <div class="form-group" id="div-class_type_css">
                    <label for="c-class_type" class="control-label col-xs-12 col-sm-2">课堂类型:</label>
                    <div class="col-xs-12 col-sm-8" id="div-class_type">
                        <select name="row[class_type]" id="c-class_type" class="form-control selectpicker" data-rule="">
                            <option value="1" {if $row[
                            "class_type"]=="1"} selected{/if}>声乐</option>
                            <option value="2" {if $row[
                            "class_type"]=="2"} selected{/if}>美书</option>
                            <option value="3" {if $row[
                            "class_type"]=="3"} selected{/if}>书法</option>
                            <option value="4" {if $row[
                            "class_type"]=="4"} selected{/if}>舞蹈</option>
                            <option value="5" {if $row[
                            "class_type"]=="5"} selected{/if}>健身</option>
                            <option value="6" {if $row[
                            "class_type"]=="6"} selected{/if}>养生</option>
                            <option value="7" {if $row[
                            "class_type"]=="7"} selected{/if}>诗词</option>
                            <option value="8" {if $row[
                            "class_type"]=="8"} selected{/if}>烹饪</option>
                            <option value="9" {if $row[
                            "class_type"]=="9"} selected{/if}>花艺</option>
                            <option value="10" {if $row[
                            "class_type"]=="10"} selected{/if}>心理</option>
                        </select>
                    </div>
                </div>
                {/if}
                {if $admin["group_id"]==1||$admin["group_id"]==2||$admin["group_id"]==3}
                <div class="form-group" id="div-subject_lv_css">
                    <label for="c-subject_lv" class="control-label col-xs-12 col-sm-2">学科层级:</label>
                    <div class="col-xs-12 col-sm-8" id="div-subject_lv">
                        <select name="row[subject_lv]" id="c-subject_lv" class="form-control" style="height:350px">
                        </select>
                    </div>
                </div>
                {/if}
                <input type="hidden" id="c-school_id" name="row[school_id]" value="{$admin['school_id']}" class="form-control" data-rule=""
                       data-tip="学校"/>

                <input type="hidden" id="c-community_id" name="row[community_id]" value="{$admin['community_id']}" class="form-control"
                       data-rule="" data-tip="社区"/>
            </div>

            <div class="tab-pane fade in" id="tabs_3">

                <div class="form-group">
                    <label for="c-hour" class="control-label col-xs-12 col-sm-2">课时节数:</label>
                    <div class="col-xs-12 col-sm-8" id="div-hour">
                        <input type="number" id="c-hour" name="row[hour]" value="10" class="form-control" title="hour"
                               data-rule="integer" placeholder="只能填入整数" data-tip="课时"/>
                    </div>
                </div>

                <div class="form-group">
                    <label for="c-ckrqsxtj_date_begin" class="control-label col-xs-12 col-sm-2">起始日期:</label>
                    <div class="col-xs-12 col-sm-8" id="div-ckrqsxtj_date_begin">
                        <div class="form-inline">
                            <input type="text" id="c-ckrqsxtj_date_begin" name="row[ckrqsxtj_date_begin]"
                                   value="<?php echo date('Y-m-d');?>" class="form-control datetimepicker"
                                   data-date-format="YYYY-MM-DD" data-tip="起始日期" data-rule=""/>
                        </div>
                    </div>
                </div>

                <div class="form-group">
                    <label for="c-sksjd" class="control-label col-xs-12 col-sm-2">上课时间段:</label>
                    <div class="col-xs-12 col-sm-8" id="div-sksjd">
                        <textarea type="text" id="c-sksjd" name="row[sksjd]"
                                  class="form-control"
                                  data-tip="示例:<div class='selectall'><p>&nbsp;&nbsp;&nbsp;&nbsp;<p>每周一、三、五09:00-09:45<br>
每周二11:00-11:45<br>
每周四15:00-15:45<br>
每周六16:00-16:45<br>
每月1、2、15号10:00-10:45
</div>" style="height: 186px; width: 317px;">每周一、三、五09:00-09:45</textarea>
                    </div>

                    <label for="c-skip_holiday" class="control-label col-xs-12 col-sm-2">跳过假日:</label>
                    <div class="col-xs-12 col-sm-8" id="div-skip_holiday">
                        <label for="skip_holiday0"><input id="skip_holiday0" name="row[skip_holiday]"
                                                          type="radio" value="0" checked/>
                            否</label>

                        <label for="skip_holiday1"><input id="skip_holiday1" name="row[skip_holiday]"
                                                          type="radio" value="1"/>
                            是</label>
                    </div>
                </div>

                <div class="form-group">
                    <label for="c-classes_id" class="control-label col-xs-12 col-sm-2">班级:</label>
                    <div class="col-xs-12 col-sm-8" id="div-classes_id">
                        <select name="classes_id" id="c-classes_id" class="form-control"   multiple="true" style="height:250px">
                        </select>
                    </div>
                </div>

                {if $admin['group_id']==1||$admin['group_id']==2||$admin['group_id']==8}
                <div class="form-group" id="div-class_type2_css">
                    <label for="c-class_type" class="control-label col-xs-12 col-sm-2">课堂类型:<br>(按Ctrl键多选)</label>
                    <div class="col-xs-12 col-sm-8" id="div-class_type2">
                        <select name="class_type" id="c-class_type2" class="form-control selectpicker" data-rule="" multiple="true">
                            <option value="1">声乐</option>
                            <option value="2">美术</option>
                            <option value="3">书法</option>
                            <option value="4">舞蹈</option>
                            <option value="5">健身</option>
                            <option value="6">养生</option>
                            <option value="7">诗词</option>
                            <option value="8">烹饪</option>
                            <option value="9">花艺</option>
                            <option value="10">心理</option>
                        </select>
                    </div>
                </div>
                {/if}
                {if $admin['group_id']==1||$admin['group_id']==2||$admin['group_id']==3}
                <div class="form-group" id="div-subject_lv2_css">
                    <label for="c-subject_lv" class="control-label col-xs-12 col-sm-2">课堂类型:<br>(按Ctrl键多选)</label>
                    <div class="col-xs-12 col-sm-8" id="div-subject_lv2">
                        <select name="subject_lv" id="c-subject_lv2" class="form-control"  multiple="true" style="height:250px">
                        </select>
                    </div>
                </div>{/if}


                <div class="form-group" style="text-align: center">
                    <input type="button" name="autocourse" value="测试生成" id="autocourse" class="btn btn-success btn-embossed"/>
                </div>

                <div id="resulttable"></div>

                <div class="form-group"  id="realautocourse" style="text-align: center;margin-top:10px;display: none">
                    <input type="button" name="autocourse" value="正式生成" class="btn btn-success btn-embossed"/>
                </div>

            </div>
            <div class="tab-pane fade in" id="tabs_4">

                <div class="form-group">
                    <label for="c-check_time" class="control-label col-xs-12 col-sm-2">课前打卡时间:</label>
                    <div class="col-xs-12 col-sm-8" id="div-check_time">
                        <input type="text" id="c-check_time" name="row[check_time]" value="{$row.check_time}"
                               class="form-control datetimepicker" data-use-current="true"
                               data-date-format="YYYY-MM-DD HH:mm:ss" data-tip="课前打卡时间" data-rule=""/>
                    </div>
                </div>

                <div class="form-group">
                    <label for="c-course_end" class="control-label col-xs-12 col-sm-2">课堂开始时间:</label>
                    <div class="col-xs-12 col-sm-8" id="div-course_end">
                        <input type="text" id="c-course_end" name="row[course_end]" value="{$row.course_end}"
                               class="form-control datetimepicker" data-use-current="true"
                               data-date-format="YYYY-MM-DD HH:mm:ss" data-tip="课堂开始时间" data-rule=""/>
                    </div>
                </div>

                <div class="form-group">
                    <label for="c-course_start" class="control-label col-xs-12 col-sm-2">课堂结束时间:</label>
                    <div class="col-xs-12 col-sm-8" id="div-course_start">
                        <input type="text" id="c-course_start" name="row[course_start]" value="{$row.course_start}"
                               class="form-control datetimepicker" data-use-current="true"
                               data-date-format="YYYY-MM-DD HH:mm:ss" data-tip="课堂结束时间" data-rule=""/>
                    </div>
                </div>

                <div class="form-group">
                    <label for="c-after_time" class="control-label col-xs-12 col-sm-2">课后打卡时间:</label>
                    <div class="col-xs-12 col-sm-8" id="div-after_time">
                        <input type="text" id="c-after_time" name="row[after_time]" value="{$row.after_time}"
                               class="form-control datetimepicker" data-use-current="true"
                               data-date-format="YYYY-MM-DD HH:mm:ss" data-tip="课后打卡时间" data-rule=""/>
                    </div>
                </div>

                <div class="form-group">
                    <label for="c-evaluation_time" class="control-label col-xs-12 col-sm-2">评价时间:</label>
                    <div class="col-xs-12 col-sm-8" id="div-evaluation_time">
                        <input type="text" id="c-evaluation_time" name="row[evaluation_time]"
                               value="{$row.evaluation_time}" class="form-control datetimepicker"
                               data-use-current="true" data-date-format="YYYY-MM-DD HH:mm:ss" data-tip="评价时间"
                               data-rule=""/>
                    </div>
                </div>

                <div class="form-group">
                    <label for="c-longitude" class="control-label col-xs-12 col-sm-2">经度:</label>
                    <div class="col-xs-12 col-sm-8" id="div-longitude">
                        <input type="text" id="c-longitude" name="row[longitude]"
                               value="{$row.longitude}" class="form-control"
                               />
                    </div>
                </div>

                <div class="form-group">
                    <label for="c-latitude" class="control-label col-xs-12 col-sm-2">纬度:</label>
                    <div class="col-xs-12 col-sm-8" id="div-latitude">
                        <input type="text" id="c-latitude" name="row[latitude]"
                               value="{$row.latitude}" class="form-control"
                               />
                    </div>
                </div>

                <div class="form-group">
                    <label for="c-amount" class="control-label col-xs-12 col-sm-2">费用:</label>
                    <div class="col-xs-12 col-sm-8" id="div-amount">
                        <input type="text" id="c-amount" name="row[amount]"
                               value="{$row.amount}" class="form-control"
                               />
                    </div>
                </div>

                <div class="form-group">
                    <label for="c-menber_limit" class="control-label col-xs-12 col-sm-2">限制人数:</label>
                    <div class="col-xs-12 col-sm-8" id="div-menber_limit">
                        <input type="number" id="c-menber_limit" name="row[menber_limit]" value="{$row.menber_limit}"
                               class="form-control" title="menber_limit" data-rule="integer" placeholder="只能填入整数"
                               data-tip="限制人数"/>
                    </div>
                </div>
            </div>
            <div class="tab-pane fade in" id="tabs_5">

                <div class="form-group">
                    <label for="c-teacher_id" class="control-label col-xs-12 col-sm-2">教师岗:</label>
                    <div class="col-xs-12 col-sm-8" id="div-teacher_id">
                        <label for="c-teacher_id" class="control-label col-xs-12 col-sm-2"></label>
                        <div style="margin-top:-2px">
                            <input id="c-teacher_id" data-rule="" data-select-only="true"
                                   data-source="/adminht.php/user/user/lists.php?type" data-multiple="false"
                                   data-field="name" data-value="{$row.teacher_id}"
                                   class="form-control selectpage" data-rule="require" name="row[teacher_id]"
                                   type="text" value="{$row.teacher_id}">
                        </div>
                    </div>
                </div>

                <div class="form-group">
                    <label for="c-manager_id" class="control-label col-xs-12 col-sm-2">管理岗:</label>
                    <div class="col-xs-12 col-sm-8" id="div-manager_id">
                        <label for="c-manager_id" class="control-label col-xs-12 col-sm-2"></label>
                        <div style="margin-top:-2px">
                            <input id="c-manager_id" data-rule="" data-select-only="true"
                                   data-source="/adminht.php/user/user/lists.php?type" data-multiple="false"
                                   data-field="name" data-value="{$row.manager_id}"
                                   class="form-control selectpage" data-rule="require" name="row[manager_id]"
                                   type="text" value="{$row.manager_id}">
                        </div>
                    </div>
                </div>

                <div class="form-group">
                    <label for="c-reminder_user" class="control-label col-xs-12 col-sm-2">提醒人员类型:</label>
                    <div class="col-xs-12 col-sm-8" id="div-reminder_user">
                        <label for="row[reminder_user][]-1"><input id="row[reminder_user][]-1"
                                                                   name="row[reminder_user][]" type="checkbox" value="1"
                                                                   data-tip="提醒人员类型" {if in_array("1",explode(",",$row.reminder_user))}checked{/if}
                            /> 学员</label>
                        <label for="row[reminder_user][]-2"><input id="row[reminder_user][]-2"
                                                                   name="row[reminder_user][]" type="checkbox" value="2"
                                                                   data-tip="提醒人员类型" {if in_array("2",explode(",",$row.reminder_user))}checked{/if}
                            /> 教师</label>
                        <label for="row[reminder_user][]-3"><input id="row[reminder_user][]-3"
                                                                   name="row[reminder_user][]" type="checkbox" value="3"
                                                                   data-tip="提醒人员类型" {if in_array("3",explode(",",$row.reminder_user))}checked{/if}
                            /> 管理员</label></div>
                </div>
            </div>
            <div class="tab-pane fade in" id="tabs_6">

                <div class="form-group">
                    <label for="c-is_open" class="control-label col-xs-12 col-sm-2">启用空中课堂:</label>
                    <div class="col-xs-12 col-sm-8" id="div-is_open"><input id="c-switch" name="row[is_open]"
                                                                            type="hidden" value="{$row.is_open}">
                        <a href="javascript:;" data-toggle="switcher" class="btn-switcher" data-input-id="c-switch"
                           data-yes="1" data-no="0" data-confirm="确认切换开关？">
                            <i class="fa fa-toggle-on text-success {eq name=" $row.is_open" value="0"}fa-flip-horizontal
                            text-gray{/eq} fa-2x"></i>
                        </a></div>
                </div>

                <div class="form-group">
                    <label for="c-reminder" class="control-label col-xs-12 col-sm-2">提醒设置:</label>
                    <div class="col-xs-12 col-sm-8" id="div-reminder">
                        <input type="number" id="c-reminder" name="row[reminder]" value="0" class="form-control"
                               title="reminder" data-rule="integer" placeholder="只能填入整数" data-tip="提醒设置"/>
                    </div>
                </div>

                <div class="form-group">
                    <label for="c-reminder_content" class="control-label col-xs-12 col-sm-2">提醒内容:</label>
                    <div class="col-xs-12 col-sm-8" id="div-reminder_content">
                        <textarea name="row[reminder_content]" id="c-reminder_content" class="form-control" data-rule=""
                                  rows="5" data-tip="提醒内容">{$row.reminder_content}</textarea>
                    </div>
                </div>

                <div class="form-group">
                    <label for="c-reminder_time" class="control-label col-xs-12 col-sm-2">提前提醒时间:</label>
                    <div class="col-xs-12 col-sm-8" id="div-reminder_time">
                        <input type="text" id="c-reminder_time" name="row[reminder_time]" value="{$row.reminder_time}"
                               class="form-control datetimepicker" data-use-current="true"
                               data-date-format="YYYY-MM-DD HH:mm:ss" data-tip="提前提醒时间" data-rule=""/>
                    </div>
                </div>
            </div>
        </div>
    </div>
</form>

